const path = require('path');

module.exports = {
    entry: './src/invite.js',
    output:{
        path: path.resolve(__dirname, '../js/'),
        filename:'yq.js',
    },
    module: {
        rules: [
            {
                test: /\.(ts)$/,
                use: 'ts-loader',
            },
            {
                test: /\.(jpg|png|gif)$/,
                use: {
                    loader: 'url-loader',
                    options: { // 配置
                        name: '[name].[ext]', // 以源文件名字及格式输出
                        outputPath: path.resolve(__dirname, '../images/'), // 输出到images文件夹下
                    }
                }
            },
            {
                test: /\.js$/,
                exclude: /(node_modules|bower_components)/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['@babel/preset-env']
                    }
                }
            }
        ]
    }
}
